/**
 * 通用接口定义
 */
import type { RouteMeta } from 'vue-router';
import { RoleEnum } from '/@/common/enums/sysEnum';

//通用接口
export interface BasicPageParams {
  page: number;
  pageSize: number;
}

export interface BasicFetchResult<T extends any> {
  items: T[];
  total: number;
}

export interface BasicResult<T extends any> {
  records: T[];
  total: number;
}

//用户相关接口定义
export interface RoleInfo {
  roleName: string;
  value: string;
}

//菜单接口
export interface MenuTag {
  type?: 'primary' | 'error' | 'warn' | 'success';
  content?: string;
  dot?: boolean;
}

export interface Menu {
  name: string;
  icon?: string;
  path: string;
  // path contains param, auto assignment.
  paramPath?: string;
  disabled?: boolean;
  children?: Menu[];
  orderNo?: number;
  roles?: RoleEnum[];
  meta?: Partial<RouteMeta>;
  tag?: MenuTag;
  hideMenu?: boolean;
  alwaysShow?: boolean;
}

/**
 * 上传下载接口
 */
export interface UploadApiResult {
  message: string;
  code: number;
  url: string;
}